/**
 * 
 */
package com.jin.spirng_boot_learn.services.impl;


import com.jin.spirng_boot_learn.domain.security.Admin;
import com.jin.spirng_boot_learn.repository.AdminRepository;
import com.jin.spirng_boot_learn.services.AdminService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zhailiang
 *
 */
@Service
@Transactional
public class AdminServiceImpl implements AdminService {
	
	@Autowired
	private AdminRepository adminRepository;


	@Override
	public Admin create(Admin adminInfo) {

//		Admin admin = new Admin();
//		BeanUtils.copyProperties(adminInfo, admin);
		adminRepository.save(adminInfo);
		System.out.println(adminInfo.getId());

		return adminInfo;
	}


}
